The technology presented herein relates to a game apparatus and a storage medium having stored thereon a game program, and more particularly relates to a game apparatus and a storage medium having stored thereon a game program which are capable of performing a game process based on a motion applied to an input device.
For example, in Japanese Laid-Open Patent Publication No. 2007-295990 (hereinafter referred to as patent document 1), disclosed is a technique of calculating a motion direction of an the input device such as a controller in accordance with acceleration data outputted by an acceleration sensor mounted in the input device. A motion direction calculation device disclosed in the above-described patent document 1 identifies a direction in which the input device is being swung by using transition in acceleration data obtained during a predetermined period of time.
In the case of an operation performed by swinging the input device, even if motion of the input operation can be recognized highly accurately, it is difficult for a user to swing the input device in an appropriate direction. For example, suppose a case where an operation is performed to cause a predetermined object in a virtual world to move in accordance with a direction in which the input device is swung. In this case, it is very difficult to operate the input device accurately enough to cause the object to move to a specified position in the virtual world. That is, the operation performed by swinging the input device is not necessarily adaptable to an accurate operation.
Therefore, a feature of an example embodiment presented herein is to provide a game apparatus and a storage medium having stored thereon a game program which are capable of appropriately setting a moving direction in a virtual game world, in which the moving direction is set in accordance with an operation of moving an input device.
To attain the above the present embodiment has the following features. The reference numerals, step numbers and the like in the parentheses indicate the correspondence with the embodiment described below in order to aid in understanding the present embodiment, and are not intended to limit, in any way, the scope of the present embodiment.
A first aspect is a game apparatus (5) performing a game process in accordance with a motion applied to an input device (7). The game apparatus includes motion direction identifying means (CPU 10 executing step 41 to step 47, hereinafter denoted by step numbers only), moving direction setting means (S48 to S50), correction means (S52), and movement control means (S53). The motion direction identifying means identifies a motion direction (difference vector) of the input device. The moving direction setting means sets a moving direction (movement vector) of a player object (OBJ) in a virtual game world in accordance with the motion direction of the input device. The correction means corrects the moving direction set by the moving direction setting means in accordance with a positional relation between the player object and a target object (TG), which is other than the player object, in the virtual game world. The movement control means causes the player object to move in the virtual game world in accordance with the moving direction.
In a second aspect, the correction means corrects the moving direction set by the moving direction setting means such that the moving direction becomes closer to a direction which extends from the player object toward the target object in the virtual game world.
In a third aspect, guiding destination range setting means (Df4) is further included. The guiding destination range setting means sets a guiding destination range (Rt), which is larger in size than the target object and is set with respect to the target object, in the virtual game world. The correction means corrects the moving direction set by the moving direction setting means such that the player object in the virtual game world passes through a guiding destination range of the target object.
In a fourth aspect, the correction means compares the moving direction set by the moving direction setting means with a direction in which the player object in the virtual game world moves toward the target object, and corrects the moving direction in the case where both of the directions are closer to each other than a predetermined reference.
In a fifth aspect, guiding source range setting means (Df3) is further included. The guiding source range setting means sets a guiding source range (Ro), which is set with respect to the target object and is larger in size than the target object, in the virtual game world. The correction means corrects the moving direction set by the moving direction setting means in the case where the moving direction extends from the player object and passes within the guiding source range.
In sixth aspect, guiding source range setting means is further included. The guiding source range setting means sets a guiding source range, which is set with respect to the target object and is larger in size than the guiding destination range, in the virtual game world. In the case where the moving direction set by the moving direction setting means extends from the player object and passes within the guiding source range, the correction means corrects the moving direction such that the player object passes within the guiding destination range of the target object which defines the guiding source range.
In a seventh aspect, the correction means corrects the moving direction set by the moving direction setting means such that the moving direction becomes closer to a direction which extends from the player object toward the target object, in accordance with a ratio of a magnitude of the guiding destination range to a magnitude of the guiding source range (Ro:Rt).
In an eighth aspect, the guiding destination range setting means sets, as the guiding destination range, a predetermined range that is along a vertical line (L), which is perpendicular to a line connecting between the player object and the target object and runs through the target object, and that is centered on the target object. The guiding source range setting means sets, as the guiding source range, a range that is along the vertical line and that is larger than the guiding destination range centered on the target object. In the case where the moving direction, which extends from the player object, intersects with the guiding source range, the correction means corrects the moving direction so as to intersect with the guiding destination range of the target object which defines the guiding source range (FIGS. 10A and 10B).
In a ninth aspect, the guiding destination range setting means sets, as the guiding destination range, a circle which is centered on the target object and has a predetermined radius. The guiding source range setting means sets, as the guiding source range, a circle which is centered on the target object and has a radius larger than that of the guiding destination range. In the case where the moving direction, which extends from the player object, passes within the guiding source range, the correction means corrects the moving direction such that the moving direction is tangent to a circle (C1) that has a radius smaller than the radius of the guiding destination range of the target object which defines the guiding source range and that is centered on the target object (FIGS. 16A and 16B).
In a tenth aspect, the guiding destination range setting means gradually reduces a magnitude of the guiding destination range with time.
In an eleventh aspect, display control means (S54) and priority setting means (Df1) are further included. The display control means allocates the player object and a plurality of the target objects in the virtual game world, and displays at least a part of the virtual game world on display means (2). The priority setting means sets a priority of correction in advance with respect to the target objects. In the case where there are a plurality of the target objects in a display screen displayed by the display means, the correction means compares directions in which the player object in the virtual game world moves toward the target objects with the moving direction set by the moving direction setting means in order of the priority set with respect to the target objects, and corrects the moving direction by using one of the target objects whose direction is first found to be closer to the moving direction than the predetermined reference.
In a twelfth aspect, display control means is further included. The display control means allocates the player object and the target object in the virtual game world, and displays at least a part of the virtual game world on display means. The guiding source range setting means changes a magnitude of the guiding source range in accordance with a position of the target object displayed on the display means.
In a thirteenth aspect, skill calculation means is further included. The skill calculation means calculates an operation ability of a player operating the player object, in accordance with an amount of correction made by the correction means so as to cause the moving direction set by the moving direction setting means to be closer to a direction which extends from the player object toward the target object.
In a fourteenth aspect, the input device includes an acceleration sensor (701). The motion direction identifying means identifies the motion direction of the input device by using acceleration indicated by acceleration data (Da) outputted from the acceleration sensor.
In a fifteenth aspect, the motion direction identifying means includes gravity direction identifying means (S43, S44) and motion calculation means (S45). The gravity direction identifying means identifies a direction of acceleration as a direction of gravity applied to the input device, in the case where a change in the acceleration indicated by the acceleration data shows that a magnitude of the acceleration is kept equivalent to a magnitude of gravity acceleration (1 G) for a predetermined period of time. The motion calculation means identifies the motion direction of the input device in accordance with the acceleration (difference vector) which is calculated by eliminating an acceleration component in the direction of gravity from the acceleration indicated by the acceleration data.
In a sixteenth aspect, the motion direction identifying means performs a process for identifying a subsequent motion direction of the input device after a predetermined period of time passes from a time point at which the motion direction of the input device has been identified (S41).
A seventeenth aspect is directed to a computer-readable storage medium having stored thereon a game program executed on a computer (10) of a game apparatus performing a game process in accordance with a motion applied to an input device. The game program causes the computer to function as motion direction identifying means, moving direction setting means, correction means, and movement control means. The motion direction identifying means identifies a motion direction of the input device. The moving direction setting means sets a moving direction of a player object in a virtual game world in accordance with the motion direction of the input device. The correction means corrects the moving direction set by the moving direction setting means in accordance with a positional relation between the player object and a target object, which is other than the player object, in the virtual game world. The movement control means causes the player object to move in the virtual game world in accordance with the moving direction.
In an eighteenth aspect, the correction means corrects the moving direction set by the moving direction setting means such that the moving direction becomes closer to a direction which extends from the player object toward the target object in the virtual game world.
In nineteenth aspect, the computer is further caused to function as guiding destination range setting means. The guiding destination range setting means sets a guiding destination range, which is larger in size than the target object and is set with respect to the target object, in the virtual game world. The correction means corrects the moving direction set by the moving direction setting means such that the player object in the virtual game world passes through a guiding destination range of the target object.
In a twentieth aspect, the correction means compares the moving direction set by the moving direction setting means with a direction in which the player object in the virtual game world moves toward the target object, and corrects the moving direction in the case where both of the directions are closer to each other than a predetermined reference.
In a twenty-first aspect, the computer is further caused to function as guiding source range setting means. The guiding source range setting means sets a guiding source range, which is set with respect to the target object and is larger in size than the target object, in the virtual game world. The correction means corrects the moving direction set by the moving direction setting means in the case where the moving direction extends from the player object and passes within the guiding source range.
In a twenty-second aspect, the computer is further caused to function as guiding source range setting means. The guiding source range setting means sets a guiding source range, which is set with respect to the target object and is larger in size than the guiding destination range, in the virtual game world. In the case where the moving direction set by the moving direction setting means extends from the player object and passes within the guiding source range, the correction means corrects the moving direction such that the player object passes within the guiding destination range of the target object which defines the guiding source range.
In a twenty-third aspect, the correction means corrects the moving direction set by the moving direction setting means such that the moving direction becomes closer to a direction which extends from the player object toward the target object, in accordance with a ratio of a magnitude of the guiding destination range to a magnitude of the guiding source range.
In a twenty-fourth aspect, the guiding destination range setting means sets, as the guiding destination range, a predetermined range that is along a vertical line, which is perpendicular to a line connecting between the player object and the target object and runs through the target object, and that is centered on the target object. The guiding source range setting means sets, as the guiding source range, a range that is along the vertical line and that is larger than the guiding destination range centered on the target object. In the case where the moving direction, which extends from the player object, intersects with the guiding source range, the correction means corrects the moving direction so as to intersect with the guiding destination range of the target object which defines the guiding source range.
In a twenty-fifth aspect, the guiding destination range setting means sets, as the guiding destination range, a circle which is centered on the target object and has a predetermined radius. The guiding source range setting means sets, as the guiding source range, a circle which is centered on the target object and has a radius larger than that of the guiding destination range. In the case where the moving direction, which extends from the player object, passes within the guiding source range, the correction means corrects the moving direction such that the moving direction is tangent to a circle that has a radius smaller than the radius of the guiding destination range of the target object which defines the guiding source range and that is centered on the target object.
In a twenty-sixth aspect, the computer is further caused to function as display control means and priority setting means. The display control means allocates the player object and a plurality of the target objects in the virtual game world, and displays at least a part of the virtual game world on display means. The priority setting means sets a priority of correction in advance with respect to the target objects. In the case where there are a plurality of the target objects in a display screen displayed by the display means, the correction means compares directions in which the player object in the virtual game world moves toward the target objects with the moving direction set by the moving direction setting means in order of the priority set with respect to the target objects, and corrects the moving direction by using one of the target objects whose direction is first found to be closer to the moving direction than the predetermined reference.
In a twenty-seventh aspect, the guiding destination range setting means gradually reduces a magnitude of the guiding destination range with time.
In a twenty-eighth aspect based on the twenty-first aspect, the computer is further caused to function as display control means. The display control means allocates the player object and the target object in the virtual game world, and displays at least a part of the virtual game world on display means. The guiding source range setting means changes a magnitude of the guiding source range in accordance with a position of the target object displayed on the display means.
In a twenty-ninth aspect, the computer is further caused to function as skill calculation means. The skill calculation means calculates an operation ability of a player operating the player object, in accordance with an amount of correction made by the correction means so as to cause the moving direction set by the moving direction setting means to be closer to a direction which extends from the player object toward the target object.
In a thirtieth aspect, the input device includes an acceleration sensor. The motion direction identifying means identifies the motion direction of the input device by using acceleration indicated by acceleration data outputted from the acceleration sensor.
In a thirty-first aspect, the motion direction identifying means includes gravity direction identifying means and motion calculation means. The gravity direction identifying means identifies a direction of acceleration as a direction of gravity applied to the input device, in the case where a change in the acceleration indicated by the acceleration data shows that a magnitude of the acceleration is kept equivalent to a magnitude of gravity acceleration for a predetermined period of time. The motion calculation means identifies the motion direction of the input device in accordance with the acceleration which is calculated by eliminating an acceleration component in the direction of gravity from the acceleration indicated by the acceleration data.
In a thirty-second aspect, the motion direction identifying means performs a process for identifying a subsequent motion direction of the input device after a predetermined period of time passes from a time point at which the motion direction of the input device has been identified.
According to the first aspect, in a game in which a player object is caused to move in accordance with a motion of an input device, it is possible to appropriately set a moving direction of the player object in accordance with the positional relation between the player object and the target object.
According to the second aspect, the moving direction of the player object is corrected such that the player object, which is caused to move in accordance with the motion of the input device, comes closer to the target object. For example, when a player wishes to cause the player object to hit a target object in the virtual game world, the hit can be realized even if a direction in which the player object moves toward the target object is not completely identical with a direction in which the input device moves. That is, when the player moves the input device in a direction closer, to some extent, to a direction which extends from the player object toward the target object, an operation desired by the player can be achieved and an accurate operation is not required.
According to the third aspect, the game is not set such that the player object definitely hits the target object when the player moves the input device. That is, when the game is set such that the player object definitely hits the target object when the player moves the input device, the game becomes boring and uninteresting. However, since a guiding destination range is set in an area surrounding the target object, it is possible to prevent such a problem.
According to the fourth aspect, even when the player moves the input device, the moving direction is not necessarily corrected with respect to the target object. That is, the player needs to aim at the target object to some extent in order to hit the target object, whereby the amusingness of the game can be maintained.
According to the fifth aspect, a guiding source range is set in an area surrounding the target object, whereby the amusingness of the game can be maintained easily.
According to the sixth aspect, when a direction which extends from the player object toward the target object is extremely different from a direction in which the input device moves, the moving direction is not to be corrected. Further, even if the moving direction is to be corrected, in the case where a direction which extends from the player object toward the target object is far different from a direction in which the input device moves, the player object is adjusted so as not to hit the target object. That is, the player needs to move the input device so as to aim at the target object, to some extent, so as to be hit by the player object. Specifically, by adjusting a magnitude of the guiding source range, a possibility that the moving direction is to be corrected is also adjusted. Further, when a magnitude of the guiding destination range is adjusted, it is possible to adjust a degree of correction of the moving direction so as to be closer to the direction which extends from the player object toward the target object.
According to the seventh aspect, the magnitudes of the guiding source range and the guiding destination range of the target object are adjusted, whereby it is possible to adjust a ratio to cause the moving direction to be closer to a direction extending from the player object toward the target object. In other words, when a ratio of the magnitude of the guiding destination range to that of the guiding source range is adjusted, it is possible to adjust a difficulty level of a game.
According to the eighth or the ninth aspect, the guiding source range and the guiding destination range of the target object are defined with lines or circles, whereby it is possible to easily perform a process of correcting the moving direction.
According to the tenth aspect, priority of correction is set with respect to the respective target objects, and thus it is possible to set such that the player object is easily guided toward some target objects, and the player object cannot be guided easily toward other target objects.
According to the eleventh aspect, it is possible to set a game such that the player object hardly hits the target object when the game is started, and the player object comes to hit the target object easily with time.
According to the twelfth aspect, in the case where a target object performs a scroll movement with respect to the player object, for example, it is possible to adjust the player object so as to be easily guided toward the target object when the target object is in a position not to be hit easily by the player object (e.g., in an upper or a lower side of the player object)
According to the thirteenth aspect, it is possible to determine a game skill of a player by using a result of the process of correcting the moving direction.
According to the fourteenth aspect, it is possible to identify the motion of the input device by using the acceleration applied to the input device.
According to the fifteenth aspect, it is possible to identify the motion of the input device by using the acceleration from which the gravity direction applied to the input device has been subtracted.
When the input device is swung, there is a case where the acceleration in an opposite direction is applied during a series of swinging motions. Accordingly, if all the component of the acceleration including that in the opposite direction is used for determination, it is difficult to determine the direction in which the input device is being swung. According to the sixteenth aspect, acceleration which occurs during a predetermined period of time after the moving direction of the input device is identified is excluded from next motion determination, and accordingly, it is possible to prevent the acceleration in the direction opposite to the acceleration used in the most recent motion determination from being used for the next motion determination.
With a storage medium having stored thereon a game program of the present embodiment, it is possible to attain the same effects as in the case of the above-described game apparatus.
These and other features, aspects and advantages of the present embodiment will become more apparent from the following detailed description of the present invention embodiment when taken in conjunction with the accompanying drawings.